
package javaapplication8;


public class chess {
    static int x(int a){return a / 8;}
    static int y(int a){return a % 8;}
    static char[] mc={'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h'};
    static char yc(int a){return mc[y(a)];}
    static String pair(int a){return ""+yc(a)+x(a);}
    static int d(int a){return x(a)+y(a);}
    static int dm(int a){return x(a)-y(a);}
    static boolean test(int a, int b){
      if(x(a)==x(b))return true;
      if(y(a)==y(b))return true;
      if(d(a)==d(b))return true;
      if(dm(a)==dm(b))return true;      
      return false;
    }
    void run() {
        int k=0;
        for (int i0 = 0; i0 < 64; i0++) {
            for (int i1 = i0+1; i1 < 64; i1++) {
                if(test(i0, i1))continue;
                for (int i2 = i1+1; i2 < 64; i2++) {
                  if(test(i0, i2))continue;
                  if(test(i1, i2))continue;
                  for (int i3 = i2+1; i3 < 64; i3++) {
                      if(test(i0, i3))continue;
                      if(test(i1, i3))continue;
                      if(test(i2, i3))continue;
                      for (int i4 = i3+1; i4 < 64; i4++) {
                          if(test(i0, i4))continue;
                          if(test(i1, i4))continue;
                          if(test(i2, i4))continue;
                          if(test(i3, i4))continue;
                          for (int i5 = i4+1; i5 < 64; i5++) {
                              if(test(i0, i5))continue;
                              if(test(i1, i5))continue;
                              if(test(i2, i5))continue;
                              if(test(i3, i5))continue;
                              if(test(i4, i5))continue;
                              for (int i6 = i5+1; i6 < 64; i6++) {
                                  if(test(i0, i6))continue;
                                  if(test(i1, i6))continue;
                                  if(test(i2, i6))continue;
                                  if(test(i3, i6))continue;
                                  if(test(i4, i6))continue;
                                  if(test(i5, i6))continue;
                                  for (int i7 = i6+1; i7 < 64; i7++) {
                                      if(test(i0, i7))continue;
                                      if(test(i1, i7))continue;
                                      if(test(i2, i7))continue;
                                      if(test(i3, i7))continue;
                                      if(test(i4, i7))continue;
                                      if(test(i5, i7))continue;
                                      if(test(i6, i7))continue;
//                                      System.out.println(i0+" "+i1+" "+i2+" "+i3+" "+i4+" "+i5+" "+i6+" "+i7);
                                      System.out.println(pair(i0));
                                      System.out.println(pair(i1));
                                      System.out.println(pair(i2));
                                      System.out.println(pair(i3));
                                      System.out.println(pair(i4));
                                      System.out.println(pair(i5));
                                      System.out.println(pair(i6));
                                      System.out.println(pair(i7));
                                      k++;
/*                                      System.out.println("k="+k);*/
                                  }
                              }
                          }
                      }
                    
                  }
                    
                }
                
            }
        }
    }
}
